﻿// Decompiled with JetBrains decompiler
// Type: System.Web.Razor.RazorCodeLanguage
// Assembly: System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
// MVID: 682513D6-F37E-48AC-9909-F3EE103CFF14
// Assembly location: D:\Project\Idea\无人机外网\uav\客户端工程\排查工具\bin\Release\System.Web.Razor.dll

using System.Collections.Generic;
using System.Web.Razor.Generator;
using System.Web.Razor.Parser;

namespace System.Web.Razor
{
  /// <summary>Represents the base for all Razor code language.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.</summary>
  public abstract class RazorCodeLanguage
  {
    private static IDictionary<string, RazorCodeLanguage> _services = (IDictionary<string, RazorCodeLanguage>) new Dictionary<string, RazorCodeLanguage>((IEqualityComparer<string>) StringComparer.OrdinalIgnoreCase)
    {
      {
        "cshtml",
        (RazorCodeLanguage) new CSharpRazorCodeLanguage()
      },
      {
        "vbhtml",
        (RazorCodeLanguage) new VBRazorCodeLanguage()
      }
    };

    /// <summary>Gets the list of language supported by the Razor code.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.</summary>
    /// <returns>The list of language supported by the Razor code.</returns>
    public static IDictionary<string, RazorCodeLanguage> Languages => RazorCodeLanguage._services;

    /// <summary>Gets the language name of the current Razor code, that is “csharp” or “vb”.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.</summary>
    /// <returns>The language name of the current Razor code.</returns>
    public abstract string LanguageName { get; }

    /// <summary>Gets the type of the CodeDOM provider.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.</summary>
    /// <returns>The type of the CodeDOM provider.</returns>
    public abstract Type CodeDomProviderType { get; }

    /// <summary>Gets the language of the Razor code using the specified file extension.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.</summary>
    /// <returns>The language of the Razor code.</returns>
    /// <param name="fileExtension">The file extension.</param>
    public static RazorCodeLanguage GetLanguageByExtension(string fileExtension)
    {
      RazorCodeLanguage razorCodeLanguage = (RazorCodeLanguage) null;
      RazorCodeLanguage.Languages.TryGetValue(fileExtension.TrimStart('.'), out razorCodeLanguage);
      return razorCodeLanguage;
    }

    /// <summary>Creates the code parser for the Razor code language.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.</summary>
    /// <returns>The code parser for the Razor code language.</returns>
    public abstract ParserBase CreateCodeParser();

    /// <summary>Creates the code generator for the Razor code language.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.</summary>
    /// <returns>The code generator for the Razor code language.</returns>
    /// <param name="className">The class name.</param>
    /// <param name="rootNamespaceName">The name of the root namespace.</param>
    /// <param name="sourceFileName">The source file name.</param>
    /// <param name="host">The Razor engine host.</param>
    public abstract RazorCodeGenerator CreateCodeGenerator(
      string className,
      string rootNamespaceName,
      string sourceFileName,
      RazorEngineHost host);
  }
}
